package com.NHL.modules.core
{
	import flash.display.Sprite;
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	
	public class GCompenent extends Sprite
	{
		private static const _defaultWidth:Number = 20;
		
		private static const _defaultHeight:Number = 20;		
		
		
		private var _width:Number;
		
		private var _height:Number;
		
		private var _scaleX:Number;
		
		private var _scaleY:Number;
		
		private  static var _timer:Timer = new Timer(10,1);
		public function GCompenent()
		{
			super();
		}
		
		public function get scaleY():Number
		{
			return _scaleY;
		}

		public function set scaleY(value:Number):void
		{
			_scaleY = value;
		}

		public function get scaleX():Number
		{
			return _scaleX;
		}

		public function set scaleX(value:Number):void
		{
			_scaleX = value;
		}

		public function get height():Number
		{
			return _height;
		}
		
		public function set height(value:Number):void
		{
			if(value!=_height)
			{
				_height = value? value:_defaultHeight;
				repaint();
			}
		}
		
		public function get width():Number
		{
			return _width;
		}
		
		public function set width(value:Number):void
		{
			if(value!=_width)
			{
				_width = value? value:_defaultWidth;
				repaint();
			}			
		}
		
		private function repaint():void
		{
			_timer.addEventListener(TimerEvent.TIMER,draw,false,0,true);
		}
		
		protected function draw():void
		{
			_timer.removeEventListener(TimerEvent.TIMER,draw);
		}
		
		
	}
}